// color scheme: https://coolors.co/e63946-585b57-7b9fa1-264456-0b1420
// @import url("https://fonts.googleapis.com/css?family=Lato:400,400i,700");

* {
  margin: 0;
  padding: 0;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  background: #1A1E23;
}

.todo-list {
  display: flex;
  flex-direction: column;
  padding: 0 75px 10px 30px;
  background: #162740;
  border: transparent;

  .todo-list__title {
    padding: 10px 6px;
    color: #f1faee;
    background-color: #264456;
  }

  .todo-list__label {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    font-size: 24px;
    font-family: Lato, sans-serif;
    color: #f1faee;
    cursor: pointer;
    input[type="checkbox"] {
      opacity: 0;

      // 白色选择框
      & + .check {
        position: absolute;
        width: 25px;
        height: 25px;
        border: 2px solid #f1faee;
        transition: 0.2s;
      }
      // input被选中，其紧挨的class = check元素
      &:checked + .check {
        // 对勾
        border-top: transparent;
        border-right: transparent;
        transform: rotate(-45deg);
      }
      // 与input同一父亲且同一级后面的（不要求相邻）span元素
      & ~ span {
        position: relative;
        left: 40px;
        transition: 0.5s;

        &::before {
          position: absolute;
          content: "";
          top: 50%;
          left: 0;
          width: 100%;
          height: 1px;
          background: #f1faee;
          transform: scaleX(0);
          transition: transform 0.5s;
        }
      }

      &:checked ~ span {
        color: #585b57;

        &::before {
          transform: scaleX(1);
          transform-origin: left;
        }
      }
    }
  }
}
